package com.lyb.command.impl;

import com.lyb.command.AlpacaCommand;

import java.util.Scanner;

/**
 * potato 命令处理类
 *
 * @author potato
 * @version 1.4.0
 */
public class PotatoCommand implements AlpacaCommand {
    /**
     * 负责处理的命令字符串
     */
    private static final String COMMAND = "potato";

    /**
     * 格式判断，输入语句需满足以下情况
     * 1.格式：{"potato"}
     * 2.没有参数
     *
     * @param input 用户输入的语句(已切分)
     * @return 判断结果
     */
    @Override
    public boolean formatJudge(String[] input) {
        /* 若输入语句有参数则错误 */
        return input.length == 1;
    }

    /**
     * 运行命令，调用相关函数输出操作结果
     *
     * @param command 命令语句
     */
    @Override
    public void go(String[] command) {
        String man = "\n" +
                "    /`   `'.\n" +
                "   /   _..---;\n" +
                "   |  /__..._/  .--.-.\n" +
                "   |.'  e e | ___\\_|/____\n" +
                "  (_)'--.o.--|    | |    |\n" +
                " .-( `-' = `-|____| |____|\n" +
                "/  (         |___Gift____|\n" +
                "|   (        |_   | |  __|\n" +
                "|    '-.--';/'/__ | | (  `|\n" +
                "|      '.   \\    )\"\";--`\\ /\n" +
                "\\        ;   |--'    `;.-'\n" +
                "  |`-.__ ..-'--'`;..--'`\n" +
                "请按回车键接收礼物..." + "\n";
        System.out.print(man);
        Scanner in = new Scanner(System.in);
        String str = null;
        str = in.nextLine();

        String gift = "\n" +
                "   /###((\\o/))####/ |\n" +
                "  /_____//^\\\\____/# |\n" +
                " |       #       |# | \n" +
                " |   for # you   |# |\n" +
                " |       #       |#/\n" +
                " |______ # ___ __|/\n" +
                "送给你的，打开看看吧！\n" +
                "请按回车键拆开礼物..." + "\n";
        System.out.print(gift);
        str = in.nextLine();

        String giftWord = " /'　\\\\　　 //\\\\ \n" +
                "　　　\\\\　 //　`\\ \n" +
                "　　　 \\\\ //           (提前)祝您：\n" +
                "　　　.-'^'-. \n" +
                "　　.' a___a `.           春节愉快 合家欢乐！\n" +
                "　 ==　(___)　== \n" +
                "　　'. ._I_. .'           心想事成 红包拿来！\n" +
                "____/.`-----'.\\____ \n" +
                "   [###(__)####      \n";
        System.out.print(giftWord);
    }

    @Override
    public String getCommand() {
        return COMMAND;
    }
}
